package com.zhanggm.zyk.order.controller;


import com.zhanggm.zyk.order.config.AjaxResult;
import com.zhanggm.zyk.order.utils.JavaMailUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.mail.internet.MimeMessage;

@RestController
@RequestMapping("test")
public class TestController {

    @Autowired
    private JavaMailUtils javaMailUtils;


    @GetMapping("testMail")
    public AjaxResult testMail(String to, String content) {
        javaMailUtils.send(to, content);
        return AjaxResult.success();
    }



}
